
<template>
  <el-container style="height: 100%; border: 1px solid #eee;margin-left: -1px;">
    <el-aside :width="aside_width" style="background-color: rgb(238, 241, 246);height: 100%">
      <MyAside :isCollapse="isCollapse"></MyAside>
    </el-aside>

    <el-container style="height: 100%;">
      <el-header style="text-align: right; font-size: 12px;height: 100%;border-bottom: #8e8787 1px solid">
        <MyHeader @doCollapse="doCollapse" :icon="icon"></MyHeader>
      </el-header>

      <el-main style="height: 100%;">
<!--        <MyMain></MyMain>-->
        <router-view/>
      </el-main>

    </el-container>
  </el-container>
</template>
<script>
import MyAside from "@/components/MyAside.vue";
import MyHeader from "@/components/MyHeader.vue";


export default {
  name: "MyIndex",
  components: { MyHeader, MyAside},
  data(){
    return {
      isCollapse:false,
      aside_width:'200px',
      icon:'el-icon-s-fold'
    }
  },
  mounted() {
    document.body.style.backgroundImage = 'url(../img/bg01.jpg)';
  },
  methods:{
    doCollapse(){
      console.log(111)
      this.isCollapse = !this.isCollapse
      if(!this.isCollapse){
        this.aside_width='200px'
        this.icon='el-icon-s-fold'
      }else{
        this.aside_width='64px'
        this.icon='el-icon-s-unfold'
      }
    },

  }
};
</script>
<style scoped>

    .el-header {
      #background-color: #B3C0D1;
      color: #333;
      line-height: 60px;
    }

    .el-aside {
      color: #333;
    }
    .el-main {
      padding: 5px;
    }

</style>